##
## Makefile for sudoku in /home/morgan_t//Downloads/sudoku-fini
## 
## Made by thomas morgant
## Login   <morgan_t@epitech.net>
## 
## Started on  Sun May  8 17:14:14 2011 thomas morgant
## Last update Thu Jul 12 16:05:22 2012 thomas morgant
##

NAME		=	server

INCLUDE		=	.			\
			./inc/			\
			$(SERVER)inc/		\
			$(COMMONS)inc/		\

########################################################

HOME		=	../
COMMONS		=	$(HOME)common/
LIB		=	$(HOME)lib/
SERVER		=	$(HOME)server/
LOCAL		= 	./src/
COMMON		=	$(COMMONS)src/

########################################################

SRCS		=	$(LOCAL)main.c			\
			$(LOCAL)run.c			\
			\
			$(LOCAL)init_serv.c		\
			$(LOCAL)init_struct_serv.c	\
			\
			$(LOCAL)map.c			\
			$(LOCAL)create_map.c		\
			\
			$(LOCAL)get_params.c		\
			\
			$(LOCAL)check_params.c		\
			$(LOCAL)check_port.c		\
			$(LOCAL)check_name.c		\
			$(LOCAL)check_clients.c		\
			$(LOCAL)check_height.c		\
			$(LOCAL)check_time.c		\
			$(LOCAL)check_width.c		\
			\
			$(COMMONS)xbind.c		\
			$(COMMONS)xmalloc.c		\
			$(COMMONS)xlisten.c		\
			$(COMMONS)xselect.c		\
			$(COMMONS)xsocket.c

########################################################

OBJ		=	$(SRCS:.c=.o)

########################################################

CC		=	gcc

RM		=	rm -f

CFLAGS		+=	-W -Wall -Wextra -ansi -pedantic \
			$(addprefix -I, $(INCLUDE))

########################################################

.PHONY		:	clean fclean

########################################################

$(NAME)		:	$(OBJ)
			$(CC) $(CFLAGS) $(OBJ) -o $@

all		:	$(NAME)
			@echo -e "\n\033[33mCompilation : DONE !\033[m\n"

clean		:
			$(RM) *~
			$(RM) $(OBJ)
			@echo -e "\n\033[33mClean : DONE !\033[m\n"

fclean		:	clean
			$(RM) $(NAME)
			@echo -e "\n\033[33mFull clean : DONE !\033[m\n"

re		:	fclean all

########################################################